package com.common.global;

/**
 * @author johnny
 * @create 2021-05-14 4:06 下午
 **/
public enum CommonEnum implements BaseErrorInterface {

    // 数据操作错误定义
    SUCCESS("200", "成功!"),
    BODY_NOT_MATCH("400", "请求的数据格式不符!"),
    SIGNATURE_NOT_MATCH("401", "请求的数字签名不匹配!"),
    NOT_FOUND("404", "未找到该资源!"),
    INTERNAL_SERVER_ERROR("500", "服务器内部错误!"),
    SERVER_BUSY("503", "服务器正忙，请稍后再试!"),

    TOKEN_ERROR("40001", "Token错误或者过期!"),
    TOKEN_NOT_FIND("40000", "无Token!"),

    ID_NOT_NULL("60000", "id不能为空!"),
    ID_NOT_FIND_ENTITY("60000", "找不到id 对应的数据!"),

    //TOKEN_EXPIRED("40000", "Token过期!"),
    REFRESH_TOKEN_EXPIRED("40000", "跳转到登录"),
    FILE_UPLOAD_FAIL("60000", "文件上传失败"),
    PARAMS_SHORTAGE("60000", "参数不足"),

    EXCEL_DATA_FORMAT("60000", "excel 数据格式不正确 请检查 整形 日期型 等数据"),

    EXCEL_EXPORT_ERROR("60000", "EXCEL 导出异常"),

    OLD_PASSWORD_ERROR("60000","原始密码不正确");
    /**
     * 错误码
     */
    private String resultCode;

    /**
     * 错误描述
     */
    private String resultMsg;

    CommonEnum(String resultCode, String resultMsg) {
        this.resultCode = resultCode;
        this.resultMsg = resultMsg;
    }


    @Override
    public String getResultCode() {
        return this.resultCode;
    }

    @Override
    public String getResultMsg() {
        return this.resultMsg;
    }
}